package
{
	import mx.collections.ArrayCollection;
	
	public class WordLocation
	{
		public var name:String = new String();
		public var eng:String = new String();
		public var sp:ArrayCollection = new ArrayCollection();
		public var ep:ArrayCollection = new ArrayCollection();
		public var color:ArrayCollection = new ArrayCollection();
		public var search:ArrayCollection = new ArrayCollection();
		
		public function WordLocation(name:String, eng:String)
		{
			this.name = name;
			this.eng = eng;
		}
		
		public function addPoint(sp:int, ep:int, color:uint):void{			
			this.sp.addItem(sp);
			this.ep.addItem(ep);
			this.color.addItem(color);
			this.search.addItem(true);
		}
		
		public function addPointAt(index:int, sp:int, ep:int, color:uint):void{			
			this.sp.addItemAt(sp,index);
			this.ep.addItemAt(ep,index);
			this.color.addItemAt(color,index);
			this.search.addItemAt(true,index);
		}
		public function deletPointAt(index:int):void{			
			this.sp.removeItemAt(index);
			this.ep.removeItemAt(index);
			this.color.removeItemAt(index);
			this.search.removeItemAt(index);
		}
				
				
		public function getSize():int{
			return sp.length;
		} 
		
		public function reset():void{
			sp.removeAll();
			ep.removeAll();
			color.removeAll();
			search.removeAll();
		}
				
		public function isSearch(index:int):Boolean{
			return (Boolean)(search.getItemAt(index));
		}
				
		public function allSearchFalse():void{
			var i:int;
			
			for(i=0; i<search.length; i++){
				search.setItemAt(false,i);
			}
		}

	}
}